package org.crazyit.activiti_d1._2_CreateFromResource;

import org.activiti.engine.ProcessEngineConfiguration;

public class CreateFromResource_2 {

    public static void main(String[] args) {

        //1. 指定配置文件创建ProcessEngineConfiguration
        ProcessEngineConfiguration config = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("my-activiti2.xml","test");

        System.out.println(config.getProcessEngineName());

        //以下为错误代码:
        //结果: 抛出异常 Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'test2' is defined
        ProcessEngineConfiguration config2 = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("my-activiti2.xml","test2");

        System.out.println(config2.getProcessEngineName());

    }

}
